Telegram Group & Telegram Channel
9. Program to Calculate Binary Number Calculation.

import java.util.*;

class BinaryCalculator
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);

System.out.print("First Binary: ");
String binOne = in.next();

System.out.print("Second Binary: ");
String binTwo = in.next();

int left = Integer.parseInt(binOne, 2);
int right = Integer.parseInt(binTwo, 2);

System.out.println("Sum of the binary numbers : " + Integer.toBinaryString(left + right));
System.out.println("Difference of the binary numbers : " + Integer.toBinaryString(left - right));
System.out.println("Product of the binary numbers : " + Integer.toBinaryString(left * right));
System.out.println("Quotient of the binary numbers : " + Integer.toBinaryString(left / right));
}
}

@java_codings



tg-me.com/java_codings/13
Create:
Last Update:

9. Program to Calculate Binary Number Calculation.

import java.util.*;

class BinaryCalculator
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);

System.out.print("First Binary: ");
String binOne = in.next();

System.out.print("Second Binary: ");
String binTwo = in.next();

int left = Integer.parseInt(binOne, 2);
int right = Integer.parseInt(binTwo, 2);

System.out.println("Sum of the binary numbers : " + Integer.toBinaryString(left + right));
System.out.println("Difference of the binary numbers : " + Integer.toBinaryString(left - right));
System.out.println("Product of the binary numbers : " + Integer.toBinaryString(left * right));
System.out.println("Quotient of the binary numbers : " + Integer.toBinaryString(left / right));
}
}

@java_codings

BY Advance Java πŸ‘¨β€πŸ’»


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_codings/13

View MORE
Open in Telegram


Advance Java ‍ Telegram | DID YOU KNOW?

Date: |

Telegram has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.

The SSE was the first modern stock exchange to open in China, with trading commencing in 1990. It has now grown to become the largest stock exchange in Asia and the third-largest in the world by market capitalization, which stood at RMB 50.6 trillion (US$7.8 trillion) as of September 2021. Stocks (both A-shares and B-shares), bonds, funds, and derivatives are traded on the exchange. The SEE has two trading boards, the Main Board and the Science and Technology Innovation Board, the latter more commonly known as the STAR Market. The Main Board mainly hosts large, well-established Chinese companies and lists both A-shares and B-shares.

Advance Java ‍ from cn


Telegram Advance Java πŸ‘¨β€πŸ’»
FROM USA